Differences Between DATE_ADD() and ADDDATE() in MySQL
Both DATE_ADD() and ADDDATE() are used to add intervals (days, months, years, etc.) to a date in MySQL. While they often produce the same results, they differ in syntax flexibility and how they accept interval values.
Requires the INTERVAL keyword.
Accepts only interval expressions like INTERVAL 7 DAY, INTERVAL 2 MONTH, etc.
More explicit and supports all interval types (DAY, MONTH, YEAR, HOUR, etc.).
Can be used in two ways: with INTERVAL or with a numeric value.
When provided a number, it treats the number as days.
Supports full interval syntax when used with INTERVAL keyword.
DATE_ADD() always requires INTERVAL; ADDDATE() can skip it when adding days.
ADDDATE() accepts numeric values for days; DATE_ADD() does not.
Both functions support interval-based addition (DAY, MONTH, YEAR, etc.) when used with INTERVAL.
In summary: DATE_ADD() is always explicit and requires the INTERVAL keyword, while ADDDATE() offers a shortcut for adding days by allowing numeric values without INTERVAL.